home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Chat & Communication
/
Digsby build 37
/
digsby_setup.exe
/
lib
/
PIL
/
PcdImagePlugin.pyo
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2008-10-13
|
2KB
|
53 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.5)
__version__ = '0.1'
import Image
import ImageFile
class PcdImageFile(ImageFile.ImageFile):
format = 'PCD'
format_description = 'Kodak PhotoCD'
def _open(self):
self.fp.seek(2048)
s = self.fp.read(2048)
if s[:4] != 'PCD_':
raise SyntaxError, 'not a PCD file'
orientation = ord(s[1538]) & 3
if orientation == 1:
self.tile_post_rotate = 90
elif orientation == 3:
self.tile_post_rotate = -90
self.mode = 'RGB'
self.size = (768, 512)
self.tile = [
('pcd', (0, 0) + self.size, 196608, None)]
def draft(self, mode, size):
if len(self.tile) != 1:
return None
(d, e, o, a) = self.tile[0]
if size:
scale = max(self.size[0] / size[0], self.size[1] / size[1])
for s, o in [
(4, 0),
(2, 0),
(1, 196608)]:
if scale >= s:
break
continue
self.tile = [
(d, e, o, a)]
return self
Image.register_open('PCD', PcdImageFile)
Image.register_extension('PCD', '.pcd')